package cc.rengu.redp.flowable.bizrule.rule;

import lombok.Data;

@Data
public class RuleResult {
    public static final Boolean SUCCESS = true;
    public static final Boolean FAILURE = false;
    private Boolean code;
    private String message;

    public static RuleResult buildSuccessResult() {
        return new RuleResult(RuleResult.SUCCESS, null);
    }

    public static RuleResult buildSuccessResult(String message) {
        return new RuleResult(RuleResult.SUCCESS, message);
    }

    public static RuleResult buildFailureResult(String message) {
        return new RuleResult(RuleResult.FAILURE, message);
    }

    public RuleResult(Boolean code, String message) {
        this.code = code;
        this.message = message;
    }
}
